/**
 * 
 * @since  2009/2/27
 * @author xthsky
 * 
 * Description: 景点信息的Controller。
 * 
 */
package controller;

import java.io.IOException;
import javax.servlet.*;
import javax.servlet.http.*;

public class SightController extends HttpServlet {

	/**
	 * The doGet method of the servlet. <br>
	 *
	 * This method is called when a form has its tag value method equals to get.
	 * 
	 * @param request the request send by the client to the server
	 * @param response the response send by the server to the client
	 * @throws ServletException if an error occurred
	 * @throws IOException if an error occurred
	 */
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		String name;
		if(request.getPathInfo() == null) name = "白洋淀";
		else {
			name = request.getPathInfo().substring(1);
			name = new String(name.getBytes("ISO-8859-1"), "UTF-8");
			if(name.equals("")) name = "白洋淀";
		}
		request.setAttribute("name", name);

		RequestDispatcher view = request.getRequestDispatcher("/views/sight.jsp");
		view.forward(request, response);
	}

}
